package com.lagou.homework.mapper;

import com.lagou.homework.module.Word;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

public class WordSortMapper extends Mapper<LongWritable, Text, Word, NullWritable> {

    @Override
    protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
        context.write(new Word(0, Integer.parseInt(value.toString())), NullWritable.get());
    }

}
